import {requestDetailList} from '@/api'
const state = {
  detailList:{}
}
const mutations = {
  SET_DETAILLISTSTATE_STATE(state,value){
    state.detailList = value
  }
}
const actions = {
  async getDetailList({commit},params){
    const re = await requestDetailList(params)
    commit('SET_DETAILLISTSTATE_STATE',re)
  }
}
const getters = {
  categoryView(state){
    return state.detailList.categoryView||{}
  },
  spuSaleAttrList(state){
    return state.detailList.spuSaleAttrList||[]
  },
  skuInfo(state){
    return state.detailList.skuInfo||{}
  }
}
export default {
  namespaced:true,
  state,
  mutations,
  actions,
  getters
}